package com.bw.z.mvp.view.people;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.bw.z.R;
import com.bw.z.mvp.view.people.adapter.PeopleVpAdapter;
import com.flyco.tablayout.SlidingTabLayout;

public class PeopleFragment extends Fragment {

    private SlidingTabLayout peopleTab;
    private ViewPager peopleVp;
    private View rootView;
    private PeopleVpAdapter adapter;


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_people, container, false);
        initView();
        return rootView;
    }

    private void initView() {
        peopleTab = (SlidingTabLayout) rootView.findViewById(R.id.people_tab);
        peopleVp = (ViewPager) rootView.findViewById(R.id.people_vp);
        adapter = new PeopleVpAdapter(getFragmentManager());
        peopleVp.setAdapter(adapter);
        peopleTab.setViewPager(peopleVp);
    }
}